<template>
    <div>
        <TopNav title="精彩跟帖"/>
        <CommentMain
            v-for="comment in commentList"
            :key="comment.id"
            :commentData="comment"
        />
    </div>
</template>

<script>
    import TopNav from "../components/TopNav";
    import CommentMain from "../components/comment/main";
    export default {
        components: {
            TopNav,
            CommentMain,
        },
        data() {
            return {
                commentList: []
            }
        },
        created() {
            // 获取当前文章的评论列表
            this.$axios({
                url: "/post_comment/" + this.$route.query.id,
            }).then((res) => {
                console.log(res.data.data);

                this.commentList = res.data.data;
            });
        },
    };
</script>

<style>
</style>